# load asmcfg from idb
# export function:
import idc
import idaapi
import ida_funcs
import idautils

from example.ida.utils import guess_machine
from future.utils import viewitems, viewvalues

from miasm.core.bin_stream_ida import bin_stream_ida
from miasm.core.locationdb import LocationDB
from miasm.expression.expression import ExprLoc, ExprInt, ExprOp, ExprAssign
from miasm.ir.ir import AssignBlock

"""
load database from ea
"""
def stop_on_jmp(mdis, cur_bloc, offset_to_dis):
    jmp_instr_check = cur_bloc.lines[-1].name in ['JMP','JZ','JNZ']

    if jmp_instr_check:
        cur_bloc.bto.clear()
        offset_to_dis.clear()

